/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package recycle;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author kkkkkkkkkkkk
 */
public class FileUploadServletSimple extends HttpServlet{
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        doGet(request, response);
    }

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        processRequest(request, response);
    }

    public void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException
    {
        //Gets hold of the outputstream which can be used to
        //send data back to the browser (or whoever called 
        // the servlet).
        PrintWriter printWriter = new PrintWriter( new OutputStreamWriter(response.getOutputStream()), true);
        
        //Tells the browser that we are sending data in HTML format
        response.setContentType("text/html");
       
        // Send a small HTML document back
        printWriter.println("<HTML><BODY>This is File Upload Servlet</BODY></HTML>");
        
    }
}
